home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Scene Storm
/
Scene Storm - Volume 1.iso
/
coding
/
asm
/
demos
/
plasma_copperrgb
/
rgbplasma.s
next >
Wrap
Text File
|
1980-01-03
|
10KB
|
413 lines
*****************************************************************************
; Program : RGB + Plasma
; Coder(s): Prophet/Goldfire UK
; Notes : Old Effects, but still nice if used propally
; Three routines here :-
; SINEPLASMA - Boring Yuk!
; SLOWRGB - My first RGB version, dunno why I`ve kept it!
; FASTRGB - New RGB Version, fastest RGB around??!!??
*****************************************************************************
OPT C-,O+
Section Mycode,CODE_C
START JMP RUN(PC)
Include ram:hw.s
Include ram:trig.s
Openlib equ -552
Closelib equ -414 ;...Equates for OS calls...
Oslist equ 38
Forbid equ -132
Permit equ -138
gfxname dc.b "graphics.library",0
storelist dc.l 0
CloseDown:
lea custom,a5
move.l 4.w,a6
bset #1,ciaa+pra ;Led Off
jsr forbid(a6)
blitwait ;Multitask down so let any Blits end
lea gfxname,a1
moveq #0,d0
jsr openlib(a6) ;open gfxlib
move.l d0,a1 ;Put gfx base addr in a1
move.l oslist(a1),storelist ;store OS copper addr
jsr closelib(a6) ;close gfxlib
catchVB
move #$0020,dmacon(a5) ;sprite DMA off
move #$8640,dmacon(a5)
move #$8100,dmacon(a5)
move #$4020,intena(a5) ;Master & VB off
move.l $6c.w,oldlev3+2
move.l #level3,$6c.w
move #$c010,intena(a5) ;Master & Copper On
catchVB
move #$0080,dmacon(a5)
move.l #Copperlist,cop1lc(a5)
move #0,copjmp1(a5)
move #$8080,dmacon(a5)
rts
SetupPointers:
;Set up Bitplane Pointers
move.l #screen,d0
move.w d0,pl0l
swap d0
move.w d0,pl0h
swap d0
add.l #10240,d0
move.w d0,pl1l
swap d0
move.w d0,pl1h
swap d0
add.l #10240,d0
move.w d0,pl2l
swap d0
move.w d0,pl2h
swap d0
add.l #10240,d0
move.w d0,pl3l
swap d0
move.w d0,pl3h
rts
Restore:
bclr #1,ciaa+pra ;Led On
move #$7e0,dmacon(a5) ;Dma (incl nasty blit) off
move.l storelist(pc),cop1lc(a5)
move #0,copjmp1(a5)
move #$83e0,dmacon(a5)
move #$4010,intena(a5)
move.l oldlev3+2,$6c.w
move #$c020,intena(a5)
jsr permit(a6)
moveq #0,d0
rts ;Go Home.....
RUN: bsr CopperInit
Bsr CreateSinus
bsr SetupPointers
bsr CloseDown
mouse: btst #6,ciaa+pra
bne.s mouse
bsr.s Restore
rts
*****************************************************************************
; Level 3 interrupt handler.......
*****************************************************************************
level3:
movem.l a0-a6/d0-d7,-(sp)
lea custom,a5
btst #4,(intreqr+1)(a5) ;Check for copper IR
beq.s notcopper
;Move.w #$0,$DFF180
Bsr NewRGB
;Bsr DORGB
;Bsr DoPlasma
;Move.w #$F,$DFF180
;-- Call routine here
move.w #$10,intreq(a5) ;Clear IR
notcopper:
movem.l (sp)+,a0-a6/d0-d7
oldlev3:
jmp $0.l
Blanksprite dc.w 0,0
fr dc.w 50
*****************************************************************************
; Plasma Routines... First of Setup Routines...
*****************************************************************************
CopperHeight = 200 lines
CopperWidth = 40 bytes
CopWidthSize = ((CopperWidth+1)*4)
CopperSize = CopWidthSize*CopperHeight
CopperStart = $403ffffe $703fFFFE
CreateSinus:
Lea SINETAB,a1
Lea SINTAB,a2
Move.l #511,d5
SinLoop Move.w (a1)+,d0
Muls #Copperheight,d0
Lsr.l #8,d0
Lsr.l #6,d0
Move.w d0,(a2)+
Dbra d5,SinLoop
Rts
CopperInit:
Lea Copper,a0
Lea CopperTable,a1
Move.l #CopperStart,d0
Move.l #(CopperHeight-1),d4
InitLp1 Move.l d0,(a0)+
Add.l #$01000000,d0
Move.l #(CopperWidth-1),d5
Move.l #$01820000,d1
InitLp2 Move.l d1,(a0)+
;Add.l #$1,d1
Dbra d5,InitLp2
Dbra d4,InitLp1
Rts
*****************************************************************************
; Normal Sine Wave Plasma Coded by Prophet/Goldfire UK
*****************************************************************************
DOPLASMA:
Move.l PlasStart,d0
Lea CopperTable+(CopperHeight),a1
Move.l #32,d1
Bsr CopperWiggle
Add.l #10,PlasStart
Rts
PlasStart dc.l 0
CopperWiggle:
;-- INPUTS NEEDED :- d0=SinePos, a1=CopperCols, d1=SineSpeed
Lea Copper+6,a0
Clr.l d2
Move.l #(CopperWidth-1),d5
Lea SinTab,a2
Move.w #(CopWidthSize-2),bltdmod(a5)
Move.w #0,bltamod(a5)
Move.l #-1,bltafwm(a5)
Move.l #$09f00000,bltcon0(a5)
WiggleLoop
And.w #1023,d0
Move.w (a2,d0),d2
Lea (a1,d2.w),a3
Add.w d1,d0
BlitWait
Move.l a0,bltdpth(a5)
Move.l a3,bltapth(a5)
Move.w #(CopperHeight<<6)!1,bltsize(a5)
Addq.l #4,a0
Dbra d5,WiggleLoop
Rts
*****************************************************************************
; Slooow RGB Plasma Coded by Prophet/Goldfire UK
*****************************************************************************
DORGB:
Move.l SineStart,d0
Lea CopperTable+(CopperHeight),a1
Move.w #8,d1
Move.w #$F,d2
Bsr CopperWiggle2
Add.l #16,SineStart
Move.l SineStart2,d0
Lea CopperTable+(CopperHeight),a1
Move.w #12,d1 ;Step
Move.w #$F0,d2
Bsr CopperWiggle2
Add.l #12,SineStart2 ;Speed
Move.l SineStart3,d0
Lea CopperTable+(CopperHeight),a1
Move.w #16,d1
Move.w #$F00,d2
Bsr CopperWiggle2
Add.l #10,SineStart3
Rts
CopperWiggle2:
;-- INPUTS NEEDED :- d0=SinePos, a1=CopperCols, d1=SineSpeed
; d2=Mask
Lea Copper+6,a0
Clr.l d3
Move.l #(CopperWidth-1),d5
Lea SinTab,a2
Move.w d2,bltadat(a5)
Move.w #(CopWidthSize-2),bltdmod(a5)
Move.w #(CopWidthSize-2),bltcmod(a5)
Move.w #0,bltbmod(a5)
Move.l #-1,bltafwm(a5)
Move.l #$07ca0000,bltcon0(a5)
WiggleLoop2
And.w #1023,d0
Move.w (a2,d0),d3
Lea (a1,d3.w),a3 ;Copper Position
BlitWait
Move.l a0,bltdpth(a5)
Move.l a0,bltcpth(a5)
Move.l a3,bltbpth(a5)
Move.w #(CopperHeight<<6)!1,bltsize(a5)
Addq.l #4,a0
Add.w d1,d0 ;Add Step
Dbra d5,WiggleLoop2
Blitwait
Rts
CopperTable:
REPT 2
dc.w 0,0,0,0,$111,$111,$111,$111,$222,$222,$222,$222
dc.w $333,$333,$333,$333,$444,$444,$444,$444,$555,$555,$555,$555
dc.w $666,$666,$666,$666
dc.w $777,$777,$777,$777,$888,$888,$888,$888,$999,$999,$999,$999
dc.w $aaa,$aaa,$aaa,$aaa,$bbb,$bbb,$bbb,$bbb
dc.w $ccc,$ccc,$ccc,$ccc,$ddd,$ddd,$ddD,$ddD,$eeE,$eeE,$eeE,$eeE
dc.w $fff,$fff,$fff,$Fff
dc.w $eee,$eee,$eee,$eee,$ddd,$ddd,$Ddd,$Ddd,$ccc,$ccc,$Ccc,$ccc
dc.w $Bbb,$bbb,$bbb,$bbb
dc.w $aaa,$aaa,$Aaa,$aaa,$999,$999,$999,$999,$888,$888,$888,$888
dc.w $777,$777,$777,$777,$666,$666,$666,$666,$555,$555,$555,$555
dc.w $444,$444,$444,$444,$333,$333,$333,$333,$222,$222,$222,$222
dc.w $111,$111,$111,$111 ,0,0,0,0
ENDR
*****************************************************************************
; Fast RGB Plasma Coded by Prophet/Goldfire UK
*****************************************************************************
;-- Call This
NewRGB
Move.l REDST,d0
Move.l GREST,d1
Move.l BLUST,d2
Move.l #6,d3
Move.l #10,d4
Move.l #14,d5
Bsr FastRGB
Add.l #6,REDST
Add.l #4,GREST
Add.l #2,BLUST
Rts
REDST dc.l 0
GREST dc.l 0
BLUST dc.l 0
FastRGB:
;-- INPUTS NEEDED :- d0,d1,d2 - Starts d3,d4,d5 - Speeds
Lea Copper+6,a0
Lea Redbar+(CopperHeight),a1
Lea GreenBar+(CopperHeight),a2
Lea BlueBar+(CopperHeight),a3
Lea SinTab,a4
Clr.l d7
Move.l #(CopperWidth-1),d6
Move.w #(CopWidthSize-2),bltdmod(a5)
Move.w #0,bltamod(a5)
Move.w #0,bltbmod(a5)
Move.w #0,bltcmod(a5)
Move.l #-1,bltafwm(a5)
Move.l #$0FFE0000,bltcon0(a5)
WiggleLoop3
And.w #1023,d0
And.w #1023,d1
And.w #1023,d2
BlitWait
Move.w (a4,d0),d7
Lea (a1,d7.w),a6 ;Copper Position
Move.l a6,bltapth(a5)
Move.w (a4,d1),d7
Lea (a2,d7.w),a6 ;Copper Position
Move.l a6,bltbpth(a5)
Move.w (a4,d2),d7
Lea (a3,d7.w),a6 ;Copper Position
Move.l a6,bltcpth(a5)
Move.l a0,bltdpth(a5)
Move.w #(CopperHeight<<6)!1,bltsize(a5)
Addq.l #4,a0
Add.w d3,d0 ;Add Step
Add.w d4,d1 ;Add Step
Add.w d5,d2 ;Add Step
Dbra d6,WiggleLoop3
Blitwait
Move.l $4.w,a6
Rts
SineStart dc.l 0
SineStart2 dc.l 0
SineStart3 dc.l 0
SINTAB:
ds.w 512 ;1k SineTable
GreenBAR REPT 4
dc.w 0,0,0,0,$10,$00,$10,$10,$10,$20,$20,$20
dc.w $30,$20,$30,$30,$40,$30,$40,$40,$50,$40,$50,$50,$60,$50,$60,$60
dc.w $70,$60,$70,$70,$80,$70,$80,$80,$90,$80,$90,$90,$a0,$90,$a0,$a0,$b0,$a0,$b0,$b0
dc.w $c0,$b0,$c0,$c0,$d0,$c0,$D0,$D0,$E0,$d0,$E0,$E0,$f0,$e0,$f0,$f0
dc.w $e0,$d0,$e0,$e0,$d0,$c0,$d0,$d0,$c0,$b0,$c0,$c0,$b0,$a0,$b0,$b0
dc.w $a0,$90,$a0,$a0,$90,$80,$90,$90,$80,$70,$80,$80
dc.w $70,$60,$70,$70,$60,$50,$60,$60,$50,$40,$50,$50
dc.w $40,$30,$40,$40,$30,$20,$30,$30,$20,$10,$20,$20,$10,$00,$10,$10
ENDR
RedBAR REPT 4
dc.w 0,0,0,0,$100,$000,$100,$100,$200,$100,$200,$200
dc.w $300,$200,$300,$300,$400,$300,$400,$400,$500,$400,$500,$500,$600,$500,$600,$600
dc.w $700,$600,$700,$700,$800,$700,$800,$800,$900,$800,$900,$900,$a00,$900,$a00,$a00,$b00,$a00,$b00,$b00
dc.w $c00,$b00,$c00,$c00,$d00,$c00,$D00,$D00,$E00,$d00,$E00,$E00,$f00,$e00,$f00,$f00
dc.w $e00,$d00,$e00,$e00,$d00,$c00,$d00,$d00,$c00,$b00,$c00,$c00,$b00,$a00,$b00,$b00
dc.w $a00,$900,$a00,$a00,$900,$800,$900,$900,$800,$700,$800,$800
dc.w $700,$600,$700,$700,$600,$500,$600,$600,$500,$400,$500,$500
dc.w $400,$300,$400,$400,$300,$200,$300,$300,$200,$100,$200,$200,$100,$000,$100,$100
ENDR
BlueBAR REPT 4
dc.w 0,0,0,0,$1,$0,$1,$1,$2,$1,$2,$2
dc.w $3,$2,$3,$3,$4,$3,$4,$4,$5,$4,$5,$5,$6,$5,$6,$6
dc.w $7,$6,$7,$7,$8,$7,$8,$8,$9,$8,$9,$9,$a,$9,$a,$a,$b,$a,$b,$b
dc.w $c,$b,$c,$c,$d,$c,$D,$D,$E,$d,$E,$E,$f,$e,$f,$f
dc.w $e,$d,$e,$e,$d,$c,$d,$d,$c,$b,$c,$c,$b,$a,$b,$b
dc.w $a,$9,$a,$a,$9,$8,$9,$9,$8,$7,$8,$8
dc.w $7,$6,$7,$7,$6,$7,$6,$6,$5,$4,$5,$5
dc.w $4,$3,$4,$4,$3,$2,$3,$3,$2,$1,$2,$2,$1,$0,$1,$1
ENDR
*****************************************************************************
; Copperlist...
*****************************************************************************
Copperlist:
;RGB
dc.w diwstrt,$2a80
dc.w diwstop,$2ac0
;Plasma
; dc.w diwstrt,$2a81
; dc.w diwstop,$2ac1
dc.w ddfstrt,$38
dc.w ddfstop,$d0 ;Normal screen
dc.w col0,0
dc.w bpl1mod,0
dc.w bpl2mod,0
dc.w bplcon1,0
dc.w bpl1ptl
pl0l dc.w 0,bpl1pth
pl0h dc.w 0,bpl2ptl
pl1l dc.w 0,bpl2pth
pl1h dc.w 0,bpl3ptl
pl2l dc.w 0,bpl3pth
pl2h dc.w 0,bpl4ptl
pl3l dc.w 0,bpl4pth
pl3h dc.w 0
dc.w bplcon0,$1200 ;No planes
;dc.w $4001,$FF00
copper ds.b CopperSize
dc.w col1,0,col0,0,col0,0,col0,0
dc.w bplcon2,0 ;sprites behind
; dc.w $ffdf,$fffe ;wait for end of NTSC
; dc.w $9001,$fffe ;first line after screen
dc.w intreq,$8010 ;trigger copper IR
dc.w $ffff,$fffe ;endless wait
*****************************************************************************
; Screens and Banks
*****************************************************************************
Screen: dcb.b 40*256*4,$FF